using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.AuthCodeDB
{
    public class Sys_SoftAuthKeyMap : EntityTypeConfiguration<Sys_SoftAuthKey>
    {
        public Sys_SoftAuthKeyMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.SoftID)
                .HasMaxLength(50);

            this.Property(t => t.WPlace)
                .HasMaxLength(500);

            this.Property(t => t.MCodeFile)
                .HasMaxLength(500);

            this.Property(t => t.SKeyFile)
                .HasMaxLength(500);

            this.Property(t => t.MachineCode)
                .HasMaxLength(2000);

            this.Property(t => t.SoftNo)
                .HasMaxLength(50);

            this.Property(t => t.CPUID)
                .HasMaxLength(50);

            this.Property(t => t.MAC)
                .HasMaxLength(50);

            this.Property(t => t.Creator)
                .HasMaxLength(50);

            this.Property(t => t.UpdateUser)
                .HasMaxLength(50);

            this.Property(t => t.SoftVersion)
                .HasMaxLength(200);

            this.Property(t => t.DetailPlace)
                .HasMaxLength(1000);

            this.Property(t => t.Customer)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("Sys_SoftAuthKey");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.SoftID).HasColumnName("SoftID");
            this.Property(t => t.WPlace).HasColumnName("WPlace");
            this.Property(t => t.MCodeFile).HasColumnName("MCodeFile");
            this.Property(t => t.SKeyFile).HasColumnName("SKeyFile");
            this.Property(t => t.MachineCode).HasColumnName("MachineCode");
            this.Property(t => t.SoftNo).HasColumnName("SoftNo");
            this.Property(t => t.CPUID).HasColumnName("CPUID");
            this.Property(t => t.MAC).HasColumnName("MAC");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
            this.Property(t => t.Creator).HasColumnName("Creator");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.UpdateUser).HasColumnName("UpdateUser");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
            this.Property(t => t.SoftVersion).HasColumnName("SoftVersion");
            this.Property(t => t.DetailPlace).HasColumnName("DetailPlace");
            this.Property(t => t.Customer).HasColumnName("Customer");
        }
    }
}
